<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group([
    'prefix'    => 'media',
    'namespace' => 'Api',
], function () {
    Route::get('/list', "MediaController@listData")
        ->name('api.media.list');
    Route::post('/move', "MediaController@move")
        ->name('api.media.move');
    Route::delete('/delete', "MediaController@delete")
        ->name('api.media.list');
    Route::post('/upload', "MediaController@upload")
        ->name('api.media.upload');
    Route::post('/makeFolder', "MediaController@makeFolder")
        ->name('api.media.makeFolder');
    Route::get('/download', 'MediaController@download')
        ->name('api.media.download');
});

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
